<template>
 
  <view class="box-bottom">
    <!-- 左边 -->
    <view >
      <label class="radio" @click="changeAllState">
        <radio color="#f10250" :checked="checks" /><text>全选</text>
      </label>
    </view>
    <!-- 中间 -->
    <view class="box-center">
      <text>合计:</text>
      <text>￥{{checkTotal}}</text>
    </view>
    <!-- 右边 -->
    <view class="box-right">
      <button type="warn">结算{{checkcount}}</button>
    </view>
  </view>

</view>
</template>

<script>
  import {mapGetters,mapActions} from 'vuex'
  export default {
    name:"cartTotal",
    data() {
      return {
        
      };
    },
    computed:{
      ...mapGetters('myCart',['checkcount','total','checkTotal']),
      checks(){
        return this.total==this.checkcount
      }
    },
    methods:{
      ...mapActions('myCart',['getAllChange']),
      changeAllState(){
        this.getAllChange(!this.checks)
      }
    }
  }
</script>

<style lang="scss">
.box-bottom{
  display: flex;
  justify-content:space-between;
  align-items: center;
  .box-right{
    margin-right: 15px;
    
  }
  .box-center{
    text:last-child{
        color: #f10250;
    }
  
  }
}
</style>
